import request from '@/utils/request'

// 查询员工请假列表
export function listRecord(query) {
  return request({
    url: '/member/leave/list',
    method: 'get',
    params: query
  })
}

// 查询员工请假详细
export function getRecord(memberId) {
  return request({
    url: '/member/leave/' + memberId,
    method: 'get'
  })
}

// 新增员工请假
export function addRecord(data) {
  return request({
    url: '/member/leave',
    method: 'post',
    data: data
  })
}

// 修改员工请假
export function updateRecord(data) {
  return request({
    url: '/member/leave',
    method: 'put',
    data: data
  })
}

// 删除员工请假
export function delRecord(memberId) {
  return request({
    url: '/member/leave/' + memberId,
    method: 'delete'
  })
}
export function approvalLeave(data) {
  return request({
    url: '/member/leave/approval',
    method: 'post',
    params: data
  })
}

export function getOneMemberInfo(userId) {
  return request({
    url: '/system/user/getOneMember',
    method: 'post',
    params: userId
  })
}
export function getOneSelfMemberList(query) {
  return request({
    url: '/member/leave/oneself/list',
    method: 'get',
    params: query
  })
}
